GeMA
The GeMA main application
Loading...
Searching...
No Matches
Model data object methods

The model data object stores information about top-level model objects such as meshes, property sets, boundary conditions, discontinuity sets and spatial indices. It is represented in Lua by a single global variable named modelData.

Index:

Model object recovery methods

modelData:mesh(meshName)
Description: Recovers a mesh object from the model given its name.
Parameters: meshName - The mesh name (id).
Returns: Returns a mesh object or nil if the name is unknown.

Example:

local m = modelData:mesh('myMeshName')


modelData:boundaryCondition(bcName)
Description: Recovers a boundary condition object from the model given its name.
Parameters: bcName - The boundary condition name (id).
Returns: Returns a boundary condition object or nil if the name is unknown.

Example:

local bc = modelData:boundaryCondition('myBcName')


modelData:contactBoundaryCondition(cbcName)
Description: Recovers a contact boundary condition object from the model given its name.
Parameters: cbcName - The contact boundary condition name (id).
Returns: Returns a contact boundary condition object or nil if the name is unknown.

Example:

local bc = modelData:contactBoundaryCondition('myContactBcName')


modelData:propertySet(psName)
Description: Recovers a property set object from the model given its name.
Parameters: psName - The property set name (id).
Returns: Returns a property set object or nil if the name is unknown.

Example:

local ps = modelData:propertySet('myPsName')


modelData:discontinuitySet(dsName)
Description: Recovers a discontinuity set object from the model given its name.
Parameters: dsName - The discontinuity set name (id).
Returns: Returns a discontinuity set object or nil if the name is unknown.

Example:

local ps = modelData:discontinuitySet('myDsName')


modelData:spatialIndex(indexName)
Description: Recovers a spatial index object from the model given its name.
Parameters: indexName - The spatial index name (id).
Returns: Returns a spatial index object or nil if the name is unknown.

Example:

local ps = modelData:spatialIndex('myIndexName')


Model object creation methods

modelData:addNewEmptyMesh(newMeshName, dim, unit, options, pluginType)
Description: Adds a new, empty mesh to the model. Nodes and cells should be added later by calls to the appropriate node and cell adding functions: mesh:addNodes() and mesh:addCells().
Parameters: newMeshName The new mesh name (id). Must be unique.
dim The desired mesh coordinate dimension. Usually 2 or 3.
unit The coordinate unit.
options An optional table with additional attributes that are sent to the mesh creation plugin to properly initialize the new mesh. Can be used to tweak the new mesh definition. When using the standard mesh plugin, enables setting mesh options such as the coordinate unit, ghost nodes support, etc. See the plugin documentation. Important: fields whose values are sub-tables are not supported at the moment.
pluginType The optional plugin type that will be used to create the new mesh. Default is "GemaMesh.elem".
Returns: Returns a new mesh object or nil if there was an error creating the mesh.

Example:

local newm = modelData:addNewEmptyMesh('newMeshName', 2, 'm', {description = "A new mesh"})

modelData:addNewEmptyDiscSet(newDSname, description, mesh, spatiolIndex, options)
Description: Adds a new, empty discontinuitySet to the model. Attributes, Properties and Geometry should be added later by calling the discontinuitySet method ds:setDiscontinuityData().
Parameters: newDSName The new discontinuity set name (id). Must be unique.
description The discontinuitySet description.
mesh A string (mesh id) or mesh object where the discontinuities lie.
spatialIndex A string (spatialIndex id) or spatialIndex object to be used by 2D discontinuities. (Can be nil for 3D geometry)
options A table with options for the discontinuitySet. Accepts the same options as model reference discontinuitySet.
Returns: Returns a new discontinuitySet object or nil if there was an error creating the discontinuitySet.

Example:

local id = 'ds'
local desc = 'list of discontinuities'
local mesh = 'meshId'
local opt = {
addElements = true,
extraDofs = false,
addGhostNodes = addGhostNodes,
}
local ds = modelData:addNewEmptyDiscSet(id, desc, mesh, nil, opt)